// ========================== wrapper ==========================
.yakit-input-number-wrapper {
    --input-number-box-shadow-color: var(--Colors-Use-Main-Focus);
    --input-number-box-shadow-error-color: var(--yakit-danger-2);

    --input-number-border-hover-color: var(--Colors-Use-Main-Hover);
    --input-number-border-focus-color: var(--Colors-Use-Main-Primary);
    --input-number-border-error-color: var(--Colors-Use-Error-Primary);
    --input-number-border-color: var(--Colors-Use-Neutral-Border);
    --input-number-border-disabled-color: var(--Colors-Use-Neutral-Border);

    --input-number-icon-hover-color: var(--Colors-Use-Main-Hover);
    --input-number-icon-error-color: var(--Colors-Use-Error-Primary);
    --input-number-icon-disabled-color: var(--Colors-Use-Neutral-Disable);

    --input-number-hover-color: var(--Colors-Use-Main-Hover);
    --input-number-hover-error-color: var(--Colors-Use-Error-Primary);

    --input-number-background-disabled-color: var(--Colors-Use-Neutral-Bg-Hover);

    :global {
        .ant-input-number:not(.ant-input-number-disabled) {
            border-color: var(--input-number-border-color);
            background-color: var(--Colors-Use-Basic-Background);
            color: var(--Colors-Use-Neutral-Text-1-Title);
        }
        .ant-input-number:hover {
            border-color: var(--input-number-border-hover-color);
        }

        .ant-input-number-focused {
            border-color: var(--input-number-border-focus-color);
        }

        .ant-input-number-handler:hover .ant-input-number-handler-up-inner,
        .ant-input-number-handler:hover .ant-input-number-handler-down-inner {
            color: var(--input-number-hover-color);
        }

        .ant-input-number:focus,
        .ant-input-number-focused {
            box-shadow: 0 0 0 2px var(--input-number-box-shadow-color);
            z-index: 1;
        }
        .ant-input-number-affix-wrapper:focus,
        .ant-input-number-affix-wrapper-focused {
            box-shadow: 0 0 0 2px var(--input-number-box-shadow-color);
            border-color: var(--Colors-Use-Main-Hover);
        }

        .ant-input-number-affix-wrapper:not(.ant-input-number-affix-wrapper-disabled):hover {
            border-color: var(--Colors-Use-Main-Hover);
        }
        .ant-input-number-disabled:hover {
            border-color: var(--input-number-border-disabled-color);
        }
        .ant-input-number-affix-wrapper > div.ant-input-number {
            height: 26px;
        }
        .ant-input-number-handler {
            border-color: var(--input-number-border-color);
            background-color: var(--Colors-Use-Neutral-Bg);
            span {
                color: var(--Colors-Use-Neutral-Text-3-Secondary);
            }
        }
        .ant-input-number-group-addon {
            border-color: var(--input-number-border-color);
            color: var(--Colors-Use-Neutral-Text-1-Title);
            background-color: var(--Colors-Use-Neutral-Bg);
        }
        .ant-input-number-disabled {
            background-color: var(--input-number-background-disabled-color);
            cursor: not-allowed;
            border-color: var(--input-number-border-disabled-color);
            color: var(--input-number-icon-disabled-color);
            svg {
                color: var(--input-number-icon-disabled-color);
            }
        }
    }
}
.yakit-input-number-wrapper-small {
    :global {
        .ant-input-number-affix-wrapper > div.ant-input-number {
            height: 22px;
        }
    }
}
.yakit-input-number-wrapper-large {
    :global {
        .ant-input-number-affix-wrapper > div.ant-input-number {
            height: 30px;
        }
    }
}

.yakit-input-number-wrapper-max-large {
    :global {
        .ant-input-number-affix-wrapper > div.ant-input-number {
            height: 38px;
        }
    }
}

.yakit-input-number-focus {
    border-radius: 4px;
}

// ========================== midden ==========================
.yakit-input-number {
    height: 28px;
    border-radius: 4px;
    line-height: 28px;
    display: inline-flex;
    align-items: center;
    font-size: 12px;

    :global {
        .ant-input-number-input {
            height: 28px;
        }

        .ant-input-number-input {
            padding: 0 12px;
        }
        .ant-input-number-input-wrap {
            flex: 1;
            margin-right: 24px;
        }
    }
}

// ========================== max-large ==========================
.yakit-input-number-max-large {
    height: 40px;
    line-height: 40px;

    :global {
        .ant-input-number-input {
            height: 40px;
        }
    }
}

// ========================== large ==========================
.yakit-input-number-large {
    height: 32px;
    line-height: 32px;

    :global {
        .ant-input-number-input {
            height: 32px;
        }
    }
}

// ========================== small ==========================
.yakit-input-number-small {
    height: 24px;
    line-height: 24px;

    :global {
        .ant-input-number-input {
            height: 24px;
        }
        .ant-input-number-affix-wrapper > div.ant-input-number {
            height: 22px;
            border-radius: 0;
        }
    }
}

// ========================== disabled ==========================
.yakit-input-number-wrapper-disabled .yakit-input-number-disabled {
    background: var(--input-number-background-disabled-color);
    cursor: not-allowed;
    border-color: var(--input-number-border-disabled-color);
    color: var(--Colors-Use-Neutral-Disable);
    svg {
        color: var(--input-number-icon-disabled-color);
    }
    :global {
        .ant-input[disabled] {
            background: var(--input-number-background-disabled-color);
            border-color: var(--input-number-border-disabled-color);
            color: var(--Colors-Use-Neutral-Disable);
        }
    }
}

// ========================== horizontal ==========================

.yakit-input-number-horizontal {
    display: inline-flex;
    border: 1px solid;
    border-color: var(--input-number-border-color);
    border-radius: 4px;
    align-items: center;
    user-select: none;
    transition: border 0.24s linear 0.14s;
    flex: 1;
    background-color: var(--Colors-Use-Basic-Background);
    width: 100%;

    :global {
        .ant-input-number:focus,
        .ant-input-number-focused {
            box-shadow: none;
            z-index: 1;
        }
        .ant-input-number-input-wrap {
            margin-right: 0;
        }
        .ant-input-number-input {
            padding: 0 4px;
            text-align: center;
        }
        .ant-input-number-handler-down {
            border: 0;
        }
        .ant-input-number-handler {
            border-left: 0;
        }
    }

    &:hover {
        border-color: var(--input-number-border-hover-color);
        .icon-left {
            opacity: 1;
        }
        .icon-right {
            opacity: 1;
        }
    }

    &:focus {
        box-shadow: 0 0 0 2px var(--input-number-box-shadow-color);
    }

    .icon-left {
        border-right: 1px solid var(--input-number-border-color);
        border-radius: 4px 0px 0px 4px;
        cursor: pointer;
        opacity: 0;
        color: var(--Colors-Use-Neutral-Text-1-Title);

        &:hover {
            color: var(--input-number-hover-color);
        }
    }

    .icon-right {
        border-left: 1px solid var(--input-number-border-color);
        border-radius: 0px 4px 4px 0px;
        cursor: pointer;
        opacity: 0;
        color: var(--Colors-Use-Neutral-Text-1-Title);

        &:hover {
            color: var(--input-number-hover-color);
        }
    }

    .icon-midden {
        background-color: var(--Colors-Use-Neutral-Bg-Hover);
        width: 24px;
        height: 26px;
        line-height: 26px;
        text-align: center;

        &:active {
            background-color: #f4f4f4;
        }
    }

    .icon-large {
        width: 24px;
        height: 30px;
        line-height: 30px;
    }

    .icon-small {
        width: 20px;
        height: 22px;
        line-height: 22px;
    }

    .yakit-input-number-wrapper {
        width: auto;
        border-radius: 0;
        flex: 1;
        min-width: 32px;

        :global {
            .ant-input-number-handler-wrap {
                width: 0;
            }
        }
        .yakit-input-number {
            height: 26px;
            line-height: 26px;
            :global {
                .ant-input-number-input {
                    height: 26px;
                }
            }
        }
        .yakit-input-number-small {
            height: 22px;
            line-height: 22px;
            :global {
                .ant-input-number-input {
                    height: 22px;
                }
            }
        }
        .yakit-input-number-large {
            height: 30px;
            line-height: 30px;

            :global {
                .ant-input-number-input {
                    height: 30px;
                }
            }
        }
    }

    // ========================== horizontal  disabled ==========================
    .yakit-input-number-wrapper-disabled {
        background: var(--input-number-background-disabled-color);
        cursor: not-allowed;
    }

    .icon-disabled {
        background: var(--input-number-background-disabled-color);
        cursor: not-allowed;

        svg {
            color: var(--input-number-icon-disabled-color);
        }
    }
}

.yakit-input-number-horizontal-focus {
    box-shadow: 0 0 0 2px var(--input-number-box-shadow-color);
    border-color: var(--input-number-border-focus-color);
}

.yakit-input-number-horizontal-disabled {
    background: var(--input-number-background-disabled-color);
    &:hover {
        border-color: var(--Colors-Use-Neutral-Bg);
        .icon-disabled {
            opacity: 0;
        }
    }
}

:global {
    .ant-form-item-has-error {
        .yakit-input-number-horizontal-error {
            border-color: var(--input-number-border-error-color);

            &:hover {
                border-color: var(--input-number-border-error-color);
            }

            &:focus {
                border-color: var(--input-number-border-error-color);
                box-shadow: 0 0 0 2px var(--input-number-box-shadow-error-color);
            }

            .icon-error svg {
                color: var(--input-number-icon-error-color);

                &:hover {
                    color: var(--input-number-hover-color);
                }
            }
        }

        .yakit-input-number-horizontal-focus-error {
            border-color: var(--input-number-border-error-color);
            box-shadow: 0 0 0 2px var(--input-number-box-shadow-error-color);
        }
    }
}
